package com.gobang.service;

import com.gobang.domain.dto.MoveResponseDTO;
import com.gobang.domain.dto.SurrenderRequestDTO;
import com.gobang.domain.message.GameStateUpdateMessage;
import com.gobang.domain.vo.GameRoomVO;
import com.gobang.domain.vo.SurrenderResponseVO;

/**
 * 游戏管理业务服务接口
 * 处理游戏核心业务逻辑
 * 
 * @author System
 * @since 1.0.0
 */
public interface NewGameService {

    /**
     * 查询游戏房间信息
     *
     * @param roomId 房间ID
     * @param userId 用户ID
     * @return 房间信息
     */
    GameRoomVO getRoomInfo(String roomId, Long userId);

    /**
     * 处理落子请求
     *
     * @param roomId 房间ID
     * @param userId 用户ID
     * @param row 行坐标
     * @param col 列坐标
     * @return 落子响应
     */
    MoveResponseDTO makeMove(String roomId, Long userId, int row, int col);


    /**
     * 处理游戏结束
     *
     * @param roomId 房间ID
     * @param winnerId 获胜者ID
     */
    void handleGameEnd(String roomId, Long winnerId, String endReason);

    /**
     * 获取游戏状态（WebSocket用）
     *
     * @param roomId 房间ID
     * @param userId 用户ID
     * @return 游戏状态更新消息
     */
    GameStateUpdateMessage getGameState(String roomId, Long userId);

//    /**
//     * 游戏状态更新消息类
//     */
//    class GameStateUpdateMessage {
//        private String type = "GAME_STATE_UPDATE";
//        private GameStateData data;
//
//        public GameStateUpdateMessage(GameStateData data) {
//            this.data = data;
//        }
//
//        public String getType() { return type; }
//        public GameStateData getData() { return data; }
//
//        /**
//         * 游戏状态数据
//         */
//        public static class GameStateData {
//            private String roomId;
//            private String currentTurn;
//            private String lastMove;
//            private Integer moveCount;
//            private String gameStatus;
//
//            public GameStateData(String roomId, String currentTurn, String lastMove,
//                               Integer moveCount, String gameStatus) {
//                this.roomId = roomId;
//                this.currentTurn = currentTurn;
//                this.lastMove = lastMove;
//                this.moveCount = moveCount;
//                this.gameStatus = gameStatus;
//            }
//
//            // Getters
//            public String getRoomId() { return roomId; }
//            public String getCurrentTurn() { return currentTurn; }
//            public String getLastMove() { return lastMove; }
//            public Integer getMoveCount() { return moveCount; }
//            public String getGameStatus() { return gameStatus; }
//        }
//    }
} 